(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     21579,        509]
NotebookOptionsPosition[     20649,        476]
NotebookOutlinePosition[     20986,        491]
CellTagsIndexPosition[     20943,        488]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
 RowBox[{
  RowBox[{"SeedRandom", "[", "10", "]"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{
    "initialize", " ", "random", " ", "number", " ", "generator", " ", "at", 
     " ", "the", " ", "same", " ", "values", " ", "to", " ", "get", " ", 
     "reproducible", " ", "nubers"}], " ", "-", " ", 
    RowBox[{
    "diffeent", " ", "seeds", " ", "represent", " ", "different", " ", 
     "realizations"}]}], " ", "*)"}], " "}]], "Input",
 CellChangeTimes->{{3.5029004986843266`*^9, 3.5029005239665475`*^9}, {
  3.527929014990889*^9, 3.527929038640889*^9}, {3.528007022752797*^9, 
  3.528007023876004*^9}, {3.5280137787051573`*^9, 3.5280137878936157`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"n", " ", "=", " ", "100", " ", 
  RowBox[{"(*", " ", 
   RowBox[{"excitatory", " ", "principal", " ", "neurons"}], " ", "*)"}], 
  " "}]], "Input",
 CellChangeTimes->{{3.502905937015625*^9, 3.5029059454316406`*^9}, {
  3.502954761029297*^9, 3.5029547640976562`*^9}, {3.5279984969650526`*^9, 
  3.527998506418713*^9}, {3.5279993634112067`*^9, 3.5279993669680295`*^9}, {
  3.527999739998621*^9, 3.5279997404510236`*^9}, {3.542895856382241*^9, 
  3.542895857574932*^9}}],

Cell[BoxData["100"], "Output",
 CellChangeTimes->{3.542895860863493*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"a", " ", "=", " ", "0.1"}], ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{"activity", ",", " ", 
    RowBox[{
     RowBox[{"i", ".", "e", ".", " ", "probability"}], " ", "that", " ", "a", 
     " ", "radomly", " ", "chosen", " ", "neuron", " ", "in", " ", "a", " ", 
     "memory", " ", "pattern", " ", "is", " ", "active"}]}], " ", 
   "*)"}]}]], "Input",
 CellChangeTimes->{
  3.5029062474433594`*^9, {3.5279299804648895`*^9, 3.527929981444889*^9}, {
   3.5279302544548893`*^9, 3.527930269824889*^9}, {3.5279978131346693`*^9, 
   3.5279978200611134`*^9}, {3.527999387762963*^9, 3.5279993879033637`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"c", " ", "=", " ", "0.5"}], ";"}], " "}]], "Input",
 CellChangeTimes->{{3.5029059547802734`*^9, 3.5029059611914062`*^9}, {
   3.5029772613984375`*^9, 3.5029772621640625`*^9}, {3.5029772964453125`*^9, 
   3.5029773020859375`*^9}, {3.5279235942196965`*^9, 3.527923600647938*^9}, 
   3.527923724996335*^9, 3.5279993949390087`*^9, {3.527999825034766*^9, 
   3.52799982567437*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"W", " ", "=", " ", 
    RowBox[{"Table", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"If", "[", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{"i", " ", "\[NotEqual]", " ", "j"}], ")"}], " ", "&&", " ", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"RandomReal", "[", "]"}], " ", "\[LessEqual]", " ", "c"}],
            ")"}]}], ")"}], " ", ",", " ", "1", ",", "  ", "0"}], "]"}], ",", 
      " ", "\[IndentingNewLine]", 
      RowBox[{"{", 
       RowBox[{"i", ",", " ", "1", ",", " ", "n"}], "}"}], ",", " ", 
      RowBox[{"{", 
       RowBox[{"j", ",", " ", "1", ",", " ", "n"}], "}"}]}], "]"}]}], ";"}], 
  " ", 
  RowBox[{"(*", " ", 
   RowBox[{"setup", " ", "random", " ", "connectivity", " ", "matrix"}], " ", 
   "*)"}], " "}]], "Input",
 CellChangeTimes->{{3.5028945980182967`*^9, 3.502894614850974*^9}, {
   3.502894716163458*^9, 3.502894772667581*^9}, {3.5028948811932325`*^9, 
   3.5028949005787425`*^9}, {3.5028949355722737`*^9, 3.502894983601462*^9}, {
   3.5028950465472383`*^9, 3.502895053081669*^9}, {3.5028954835093293`*^9, 
   3.5028954855836277`*^9}, {3.502895710352024*^9, 3.5028957166510944`*^9}, {
   3.5028982154609118`*^9, 3.502898262413887*^9}, 3.5028987666559052`*^9, {
   3.5028988066300964`*^9, 3.502898943701766*^9}, {3.502898978061484*^9, 
   3.5028990065840635`*^9}, {3.5028999844057903`*^9, 
   3.5029000200956373`*^9}, {3.50290030346101*^9, 3.502900312722108*^9}, {
   3.502900566451577*^9, 3.502900569462435*^9}, {3.5029008590878143`*^9, 
   3.502900871319729*^9}, 3.5029009469290776`*^9, {3.5278667145240617`*^9, 
   3.527866714543063*^9}, {3.527869646340237*^9, 3.5278696496775713`*^9}, {
   3.5278701541530137`*^9, 3.527870290611658*^9}, {3.527929798784889*^9, 
   3.527929808354889*^9}, {3.527997903162846*^9, 3.52799791620453*^9}, {
   3.5279999226445913`*^9, 3.5279999745617247`*^9}, {3.528004667462299*^9, 
   3.5280046688039074`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"store", "[", "Z_", "]"}], " ", ":=", " ", 
    RowBox[{"Module", "[", 
     RowBox[{
      RowBox[{"{", "}"}], ",", " ", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"Do", "[", 
        RowBox[{
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{"(", 
             RowBox[{
              RowBox[{
               RowBox[{"Z", "[", 
                RowBox[{"[", "i", "]"}], "]"}], " ", 
               RowBox[{"Z", "[", 
                RowBox[{"[", "j", "]"}], "]"}]}], " ", "\[Equal]", " ", "1"}],
              ")"}], ")"}], " ", ",", " ", 
           RowBox[{
            RowBox[{"J", "[", 
             RowBox[{"[", 
              RowBox[{"i", ",", " ", "j"}], "]"}], "]"}], " ", "=", " ", 
            "1"}]}], "]"}], ",", "  ", "\[IndentingNewLine]", 
         RowBox[{"{", 
          RowBox[{"i", ",", " ", "1", ",", " ", "n"}], "}"}], ",", " ", 
         RowBox[{"{", 
          RowBox[{"j", ",", " ", "1", ",", " ", "n"}], "}"}]}], "]"}], 
       ";"}]}], "\[IndentingNewLine]", "]"}]}], ";"}], 
  " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"store", "::", "usage"}], " ", "=", " ", 
   "\"\<Stores a pattern in the network, using the storage rule of a clipped \
Hebbian. Synaptic strength is increased to 1 if both neurons fire \
simultaneously. Syntax: store[Z_], where Z is the pattern to be stored. \
\>\""}], ";"}]}], "Input",
 CellChangeTimes->{{3.5028945980182967`*^9, 3.502894614850974*^9}, {
   3.502894716163458*^9, 3.502894772667581*^9}, {3.5028948811932325`*^9, 
   3.5028949005787425`*^9}, {3.5028949355722737`*^9, 3.502894983601462*^9}, {
   3.5028950465472383`*^9, 3.502895053081669*^9}, {3.5028954835093293`*^9, 
   3.5028954855836277`*^9}, {3.502895710352024*^9, 3.5028957166510944`*^9}, {
   3.5028982154609118`*^9, 3.502898262413887*^9}, {3.502898298157447*^9, 
   3.5028984917752333`*^9}, {3.50289858112925*^9, 3.502898595106349*^9}, {
   3.5028987300744224`*^9, 3.5028987388228054`*^9}, 3.502898776473665*^9, {
   3.502899029227511*^9, 3.5028990361848097`*^9}, {3.5028999091558304`*^9, 
   3.5028999213262196`*^9}, {3.502900576019327*^9, 3.50290057924992*^9}, 
   3.5029010659551325`*^9, {3.5279207068706493`*^9, 3.52792078382545*^9}, {
   3.5279298474148893`*^9, 3.527929861844889*^9}, {3.527930103074889*^9, 
   3.527930123694889*^9}, {3.5279979421006956`*^9, 3.527998001474676*^9}, {
   3.528000021268424*^9, 3.528000057476256*^9}, {3.5280040644072328`*^9, 
   3.52800409671504*^9}, {3.52800451481432*^9, 3.528004531475227*^9}, 
   3.5280048291105347`*^9, {3.5280052774106083`*^9, 3.5280052948515205`*^9}, {
   3.528007354522124*^9, 3.528007374443452*^9}, {3.528007409886879*^9, 
   3.5280075003986588`*^9}, 3.542896084982454*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"retrieve", "[", "time_", "]"}], " ", ":=", " ", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"h", " ", "=", " ", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"time", " ", ">", " ", "0"}], ",", " ", 
         RowBox[{
          RowBox[{"1", " ", "/", " ", "n"}], " ", 
          RowBox[{"Table", "[", " ", 
           RowBox[{
            RowBox[{"(", 
             RowBox[{
              UnderoverscriptBox["\[Sum]", 
               RowBox[{"j", "=", "1"}], "n"], 
              RowBox[{"(", 
               RowBox[{
                RowBox[{"W", "[", 
                 RowBox[{"[", 
                  RowBox[{"i", ",", " ", "j"}], "]"}], "]"}], "*", 
                RowBox[{"J", "[", 
                 RowBox[{"[", 
                  RowBox[{"i", ",", " ", "j"}], "]"}], "]"}], "*", 
                RowBox[{"X", "[", 
                 RowBox[{"[", "j", "]"}], "]"}]}], ")"}]}], ")"}], ",", " ", 
            RowBox[{"{", 
             RowBox[{"i", ",", " ", "1", ",", " ", "n"}], "}"}]}], "]"}]}]}], 
        " ", "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"t", " ", "=", " ", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"time", " ", ">", " ", "0"}], ",", " ", 
         RowBox[{"0.433", " ", "*", " ", 
          RowBox[{
           UnderoverscriptBox["\[Sum]", 
            RowBox[{"j", "=", "1"}], "n"], 
           RowBox[{
            RowBox[{"X", "[", 
             RowBox[{"[", "j", "]"}], "]"}], " ", "/", " ", "n"}]}]}]}], 
        "]"}]}], ";", " ", "\[IndentingNewLine]", 
      RowBox[{"XNew", " ", "=", " ", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"time", " ", ">", " ", "0"}], ",", " ", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"(", 
              RowBox[{"(", 
               RowBox[{
                RowBox[{"h", "[", 
                 RowBox[{"[", "i", "]"}], "]"}], " ", ">", " ", "t"}], ")"}], 
              ")"}], ",", " ", "1", ",", " ", "0"}], "]"}], ",", 
           "                                ", "\[IndentingNewLine]", "     ", 
           RowBox[{"{", 
            RowBox[{"i", ",", " ", "1", ",", " ", "n"}], "}"}]}], "]"}], ",", 
         " ", "X"}], " ", "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"dataY", " ", "=", " ", 
       RowBox[{"Flatten", "[", 
        RowBox[{"Position", "[", 
         RowBox[{"XNew", ",", " ", "1"}], "]"}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"dataX", " ", "=", " ", 
       RowBox[{"Table", "[", 
        RowBox[{"time", ",", " ", 
         RowBox[{"{", 
          RowBox[{"Length", "[", "dataY", "]"}], "}"}]}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"gr", " ", "=", " ", 
       RowBox[{"ListPlot", "[", 
        RowBox[{
         RowBox[{"Transpose", "[", 
          RowBox[{"{", 
           RowBox[{"dataX", ",", " ", "dataY"}], "}"}], "]"}], ",", " ", 
         RowBox[{"PlotRange", " ", "\[Rule]", " ", 
          RowBox[{"{", 
           RowBox[{"All", ",", " ", 
            RowBox[{"{", 
             RowBox[{"0", ",", " ", "n"}], "}"}]}], "}"}]}], ",", " ", 
         RowBox[{"PlotStyle", "\[Rule]", 
          RowBox[{"PointSize", "[", "0.01", "]"}]}]}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"data", " ", "=", " ", 
       RowBox[{"Transpose", "[", 
        RowBox[{"{", 
         RowBox[{"XNew", ",", " ", "Z0"}], "}"}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"model", "=", 
       RowBox[{"LinearModelFit", "[", 
        RowBox[{"data", ",", "x", ",", "x"}], "]"}]}], ";", " ", 
      "\[IndentingNewLine]", 
      RowBox[{"r", " ", "=", " ", 
       RowBox[{"Sqrt", "[", 
        RowBox[{"model", "[", "\"\<RSquared\>\"", "]"}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"X", " ", "=", " ", "XNew"}], ";", "\[IndentingNewLine]", 
      RowBox[{"{", 
       RowBox[{"gr", ",", " ", 
        RowBox[{"{", 
         RowBox[{"time", ",", " ", 
          RowBox[{"Length", "[", "dataY", "]"}]}], "}"}], ",", " ", 
        RowBox[{"{", 
         RowBox[{"time", ",", " ", "r"}], "}"}]}], "}"}]}]}], 
    "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"retrieve", "::", "usage"}], " ", "=", " ", 
   "\"\<Retrieves a pattern, Syntax: retrieve[time_], where time is the time \
step (arbitrary units). X has to be initialized. Output: {gr, {time, \
Length[dataY]}, {time, r}}, where gr is the rasterplot, next parameter is the \
number of active cells, and r is the correlation (overlap), and time is time. \
\>\""}], ";"}]}], "Input",
 CellChangeTimes->{{3.5279305628558893`*^9, 3.5279306371768894`*^9}, {
   3.527930668236889*^9, 3.5279307430668893`*^9}, {3.5279308374668894`*^9, 
   3.527930840076889*^9}, {3.527930921696889*^9, 3.5279309439668894`*^9}, {
   3.527931232486889*^9, 3.5279312493068895`*^9}, {3.527931403706889*^9, 
   3.5279314041068892`*^9}, {3.528000582436221*^9, 3.5280006010627403`*^9}, {
   3.5280007064882164`*^9, 3.528000712775057*^9}, {3.528001449813404*^9, 
   3.528001454431034*^9}, {3.5280017503025303`*^9, 3.528001764077419*^9}, {
   3.5280017985068398`*^9, 3.528001803436471*^9}, {3.528002427411271*^9, 
   3.52800248343123*^9}, {3.5280027462125206`*^9, 3.5280027470081263`*^9}, {
   3.5280036496915493`*^9, 3.528003653607225*^9}, {3.5280039989960136`*^9, 
   3.5280040192293434`*^9}, {3.528007492286607*^9, 3.5280076345439186`*^9}, {
   3.5280080001478624`*^9, 3.52800801233154*^9}, {3.5280095183986006`*^9, 
   3.528009543405561*^9}, {3.5280101262896976`*^9, 3.528010128458112*^9}, {
   3.528010366281636*^9, 3.5280104166855593`*^9}, {3.5280105639973035`*^9, 
   3.52801058688265*^9}, {3.5280106210468693`*^9, 3.528010638004178*^9}, {
   3.5280106919337234`*^9, 3.528010793958378*^9}, {3.528010936638892*^9, 
   3.5280109467165565`*^9}, {3.5280111099872036`*^9, 3.528011110533207*^9}, {
   3.528011254225728*^9, 3.5280112546313305`*^9}, {3.528011636866599*^9, 
   3.528011671935848*^9}, 3.528012660987192*^9, {3.5280134995871677`*^9, 
   3.528013503611994*^9}, 3.5280145770949636`*^9, {3.5280146600857935`*^9, 
   3.5280146640858335`*^9}, {3.528014863229878*^9, 3.5280148684409304`*^9}, {
   3.542896019294373*^9, 3.542896023373759*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"J", " ", "=", " ", 
    RowBox[{"Table", "[", 
     RowBox[{"0", ",", " ", 
      RowBox[{"{", 
       RowBox[{"i", ",", " ", "1", ",", " ", "n"}], "}"}], ",", " ", 
      RowBox[{"{", 
       RowBox[{"j", ",", " ", "1", ",", " ", "n"}], "}"}]}], "]"}]}], ";"}], 
  " ", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{"initialize", " ", "with", " ", "synaptic", " ", "strength"}], 
    " ", "=", " ", "0"}], " ", "*)"}], " "}]], "Input",
 CellChangeTimes->{{3.5280045429257*^9, 3.5280045699450736`*^9}, 
   3.528004688491234*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Z0", " ", "=", " ", 
    RowBox[{"PadRight", "[", 
     RowBox[{
      RowBox[{"Table", "[", 
       RowBox[{"1", ",", " ", 
        RowBox[{"{", 
         RowBox[{"Round", "[", 
          RowBox[{"a", " ", "n"}], "]"}], "}"}]}], "]"}], ",", " ", "n"}], 
     "]"}]}], ";"}], "   ", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{
     RowBox[{"target", " ", "memory", " ", "pattern"}], ";", " ", 
     RowBox[{"ones", " ", "on", " ", "the", " ", "left"}]}], ",", " ", 
    RowBox[{"zeros", " ", "on", " ", "the", " ", "right"}]}], " ", "*)"}], 
  " "}]], "Input",
 CellChangeTimes->{{3.502895515796702*^9, 3.5028955248361115`*^9}, {
   3.5028961418685937`*^9, 3.5028961910755615`*^9}, {3.5028962288768177`*^9, 
   3.5028962309140053`*^9}, {3.502897333653614*^9, 3.5028973452214413`*^9}, 
   3.5028987704617157`*^9, {3.502899142788512*^9, 3.5028991435932302`*^9}, {
   3.50290096525693*^9, 3.5029009696447935`*^9}, {3.5029549082421875`*^9, 
   3.5029549266376953`*^9}, 3.528007778548442*^9, {3.5280123050699105`*^9, 
   3.528012305756315*^9}, 3.5280126310974007`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"store", "[", "Z0", "]"}], ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{"store", " ", "the", " ", "target", " ", "pattern"}], " ", "*)"}], 
  " "}]], "Input",
 CellChangeTimes->{{3.5280041335312757`*^9, 3.5280041405045204`*^9}, 
   3.528004399872783*^9, {3.5280076471175995`*^9, 3.5280076624056973`*^9}, 
   3.5280126347010236`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"zPTable", "=", " ", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"Table", "[", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"RandomReal", "[", "]"}], " ", "\[LessEqual]", " ", "a"}], 
          ")"}], " ", ",", " ", "1", ",", "  ", "0"}], "]"}], ",", " ", 
       "\[IndentingNewLine]", 
       RowBox[{"{", 
        RowBox[{"i", ",", " ", "1", ",", " ", "n"}], "}"}]}], "]"}], ",", " ", 
     RowBox[{"{", "40", "}"}]}], "]"}]}], ";", " ", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{"generate", " ", "random", " ", "patterns"}], " ", "-", " ", 
    RowBox[{"in", " ", "this", " ", "case", " ", "3"}]}], " ", "*)"}], 
  " "}]], "Input",
 CellChangeTimes->{{3.5028945980182967`*^9, 3.502894614850974*^9}, {
   3.502894716163458*^9, 3.502894772667581*^9}, {3.5028948811932325`*^9, 
   3.5028949005787425`*^9}, {3.5028949355722737`*^9, 3.502894983601462*^9}, {
   3.5028950465472383`*^9, 3.502895053081669*^9}, {3.5028954835093293`*^9, 
   3.5028954855836277`*^9}, {3.502895710352024*^9, 3.5028957166510944`*^9}, {
   3.5028982154609118`*^9, 3.502898262413887*^9}, 3.5028987666559052`*^9, {
   3.5028988066300964`*^9, 3.502898943701766*^9}, {3.502898978061484*^9, 
   3.5028990065840635`*^9}, {3.5028999844057903`*^9, 
   3.5029000200956373`*^9}, {3.50290030346101*^9, 3.502900312722108*^9}, {
   3.502900566451577*^9, 3.502900569462435*^9}, {3.5029008590878143`*^9, 
   3.502900871319729*^9}, 3.5029009469290776`*^9, {3.5278667145240617`*^9, 
   3.527866714543063*^9}, {3.527869646340237*^9, 3.5278696496775713`*^9}, {
   3.5278701541530137`*^9, 3.527870290611658*^9}, {3.527929798784889*^9, 
   3.527929808354889*^9}, {3.527997903162846*^9, 3.52799791620453*^9}, {
   3.5279999226445913`*^9, 3.5279999745617247`*^9}, {3.528004667462299*^9, 
   3.5280046688039074`*^9}, {3.5280047310795064`*^9, 
   3.5280047477872133`*^9}, {3.5280047801730213`*^9, 3.528004810452815*^9}, 
   3.5280053084392076`*^9, 3.5280054618671913`*^9, {3.5280071180850077`*^9, 
   3.5280071267898636`*^9}, {3.528009432005247*^9, 3.528009433409256*^9}, {
   3.5280123200460067`*^9, 3.52801232375883*^9}, 3.5280126416430683`*^9, {
   3.5280126942466054`*^9, 3.5280126946054077`*^9}, {3.542895973843542*^9, 
   3.542895973923638*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"zPTable", " ", "//", " ", "Length"}]], "Input",
 CellChangeTimes->{{3.5280054321490006`*^9, 3.528005460291581*^9}, 
   3.528012644279485*^9}],

Cell[BoxData["40"], "Output",
 CellChangeTimes->{3.542895987096275*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"store", " ", "/@", " ", "zPTable"}], ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{"store", " ", "the", " ", "random", " ", "patterns"}], " ", "*)"}],
   " "}]], "Input",
 CellChangeTimes->{{3.52800426680293*^9, 3.5280042753361845`*^9}, 
   3.528004935674818*^9, 3.528005356426115*^9, {3.5280054524759307`*^9, 
   3.528005564375448*^9}, {3.5280071315322943`*^9, 3.5280071427955666`*^9}, {
   3.528007669566143*^9, 3.528007669800145*^9}, 3.528012647243504*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"X", " ", "=", " ", "Z0"}], ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{"activity", " ", "vector"}], " ", "-", " ", 
    RowBox[{
    "start", " ", "out", " ", "with", " ", "the", " ", "target", " ", 
     "pattern", " ", "itself"}]}], " ", "*)"}], " "}]], "Input",
 CellChangeTimes->{{3.527931263576889*^9, 3.527931293246889*^9}, {
   3.5280073059746127`*^9, 3.528007311902651*^9}, {3.52800768772466*^9, 
   3.5280076895030713`*^9}, 3.5280126705812535`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"result1", "  ", "=", " ", 
    RowBox[{"retrieve", " ", "/@", " ", 
     RowBox[{"Range", "[", 
      RowBox[{"0", ",", " ", "5"}], "]"}]}]}], ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{"5", " ", "time", " ", "steps"}], " ", "*)"}], " "}]], "Input",
 CellChangeTimes->{{3.527931120446889*^9, 3.527931137906889*^9}, {
   3.5279320839078894`*^9, 3.527932084307889*^9}, {3.527941191963825*^9, 
   3.5279411970643353`*^9}, {3.528002559526124*^9, 3.5280025655321627`*^9}, {
   3.5280026532203245`*^9, 3.528002655903542*^9}, {3.5280036581001115`*^9, 
   3.5280036593013344`*^9}, {3.52800377089128*^9, 3.528003770953682*^9}, {
   3.5280104966516714`*^9, 3.52801050725974*^9}, {3.528010810276082*^9, 
   3.5280108143633084`*^9}, 3.528011980493204*^9}]
},
WindowSize->{740, 867},
WindowMargins->{{Automatic, 75}, {Automatic, 56}},
FrontEndVersion->"8.0 for Linux x86 (32-bit) (February 23, 2011)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[557, 20, 682, 14, 69, "Input"],
Cell[CellGroupData[{
Cell[1264, 38, 491, 9, 30, "Input"],
Cell[1758, 49, 72, 1, 30, "Output"]
}, Open  ]],
Cell[1845, 53, 652, 14, 69, "Input"],
Cell[2500, 69, 423, 8, 30, "Input"],
Cell[2926, 79, 2010, 40, 88, "Input"],
Cell[4939, 121, 2793, 57, 183, "Input"],
Cell[7735, 180, 6379, 139, 521, "Input"],
Cell[14117, 321, 576, 16, 50, "Input"],
Cell[14696, 339, 1114, 25, 69, "Input"],
Cell[15813, 366, 379, 9, 30, "Input"],
Cell[16195, 377, 2347, 43, 88, "Input"],
Cell[CellGroupData[{
Cell[18567, 424, 165, 3, 30, "Input"],
Cell[18735, 429, 71, 1, 30, "Output"]
}, Open  ]],
Cell[18821, 433, 506, 10, 30, "Input"],
Cell[19330, 445, 519, 12, 30, "Input"],
Cell[19852, 459, 793, 15, 30, "Input"]
}
]
*)

(* End of internal cache information *)

